package kr.hkit.powerjava.chapter21;

class MyExcep extends Exception {
	public MyExcep() {
		super("숫자가 없어");
	}
}

public class MyExcepTest {
	public static void searchArray(int number) {
		int[] array = new int[5];
		
		for (int i = 0; i < array.length; i++) {
			array[i] = 1 + i;
		}

		try{
			
			MakeError();
		}catch(MyExcep e){
			System.out.println(e.getMessage());
		}

	}

	private static void MakeError() throws MyExcep{
		throw new MyExcep();
	}
	
	public static void main(String[] args) {
		MyExcepTest ex = new MyExcepTest();
		ex.searchArray(4);
	}
}
